package com.futures.investm.adapter;


import android.view.View;
import android.widget.ImageView;

import com.futures.investm.R;
import com.futures.investm.entity.ArticleEntity;
import com.futures.investm.utils.IntentUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import tech.com.commoncore.manager.GlideManager;


public class ArticleAdapter extends BaseQuickAdapter<ArticleEntity,BaseViewHolder> {


    public ArticleAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, final ArticleEntity item) {


        helper.setText(R.id.tv_title,item.getPost_title());

        ImageView view = helper.getView(R.id.img);



        GlideManager.loadImg(item.getMore().getThumbnail(),view);

        helper.setText(R.id.tv_time,item.getPublished_time());

        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                IntentUtils.goArticleDetailsActivity(mContext, item.getId()+"");
            }
        });


    }
}
